<template>
  <div>
    <tableComponents :pagination="{currentPage,pageSize,total:list.all_num}" @handleCurrentChange="handleCurrentChange" :isHaveAdd="false"
        @handleSizeChange="handleSizeChange" @sendUserSearch="receive_search" :searchData="userSearchData" :isHaveExport="false">
      <template v-slot:table>
        <el-table ref="multipleTable" :data="list.data" stripe v-loading="loading" header-row-class-name="head_color" tooltip-effect="dark"
            style="width: 99.8%" @selection-change="handleSelectionChange">
          <el-table-column type="selection" class="tc" width="35"></el-table-column>

          <el-table-column label="头像" min-width="80">
            <template slot-scope="scope">
              <div class="img_bor_tx">
                <img :src="$fnc.getImgUrl(scope.row.avatar)" alt />
              </div>
            </template>
          </el-table-column>

          <el-table-column label="用户信息" min-width="160">
            <template slot-scope="scope">
              <div class="tab_div">
                <div>
                  <span>用户昵称：</span>
                  <span>{{scope.row.nickname || '----'}}</span>
                </div>
                <div>
                  <span>会员账号：</span>
                  <span>{{scope.row.username ||'---'}}</span>
                </div>
              </div>
            </template>
          </el-table-column>
          <el-table-column label="提现信息" min-width="160">
            <template slot-scope="scope">
              <div class="tab_div">
                <div>
                  <span>申请金额：</span>
                  <span>{{Number(scope.row.money) }}</span>
                </div>
                <div>
                  <span>实提金额：</span>
                  <span>{{Number(scope.row.real_money || 0) || '---' }}</span>
                </div>
                <div>
                  <span>金额类型：</span>
                  <span>{{scope.row.balance_type || '---'}}</span>
                </div>
                <div>
                  <span>备注：</span>
                  <span>{{scope.row.remark || '---'}}</span>
                </div>
              </div>
            </template>
          </el-table-column>

          <el-table-column label="提现信息" min-width="160">
            <template slot-scope="scope">
              <div class="tab_div">

                <div>
                  <span>订单号：</span>
                  <span>{{scope.row.oid}}</span>
                </div>
                <div>
                  <span>回调订单号：</span>
                  <span>{{scope.row.trade_no || '---'}}</span>
                </div>
                <div>
                  <span>提现方式：</span>
                  <span>{{scope.row.pay_way  || '---'}}</span>
                </div>
                <div v-show="scope.row.openid">
                  <span>openID：</span>
                  <span>{{scope.row.openid}}</span>
                </div>
                <div>
                  <span>IP：</span>
                  <span>{{scope.row.ip || '---'}}</span>
                </div>
              </div>
            </template>
          </el-table-column>
          <el-table-column label="时间信息" min-width="220">
            <template slot-scope="scope">
              <div class="tab_div">
                <div>
                  <span>创建时间：</span>
                  <span>{{ scope.row.created_time | getTimeFormat }}</span>
                </div>
                <div>
                  <span>编辑时间：</span>
                  <span>{{ scope.row.update_time | getTimeFormat }}</span>
                </div>
              </div>
            </template>
          </el-table-column>
        </el-table>
      </template>
      <template v-slot:footerLeft>
        <div class="recharge_sum">
          <p>
            <span>累计搜索金额：</span>
            {{ Number(list.sum) }}
          </p>

        </div>
      </template>
    </tableComponents>

  </div>
</template>
<script>
import { onlineWithdrawalSearchData } from "@/assets/js/searchData/searchData"; //引入搜索的数据
export default {
  data () {
    return {
      userSearchData: onlineWithdrawalSearchData,
      current: "",
      shows: false,
      is_edit: false,
      dialogFormVisible: false,
      live_single: {
        piclink: ""
      },
      loading: false,
      list: [],
      allPage: 0,
      allNum: 0,
      pageSize: 10,
      currentPage: 1,
      searchAll: {},
      row: {},
      multipleSelection: [],
      showCity: true
    };
  },
  components: {
  },
  methods: {
    getShow (val) {
      this.shows = val;
    },
    getSend (row) {
      this.live_single.username = row.username;
      this.live_single.uid = row.id;
    },
    xzshop () {
      this.shows = true;
    },
    sorta (a, b) {
      return b - a;
    },
    sortNew (index, row) {
      var params = {};
      params = row;
      params.id = row.id;
      params.sort = row.sort;
      this.$api.getPage.edit_commentlist(params).then(res => {
        if (res.data.code == 200 && res.data.result) {
          return;
        } else {
          this.$fnc.alertError(res.data.code_desc, res.data.result); //失败弹出框
        }
      });
    },
    handleSelectionChange (val) {
      this.multipleSelection = val;
    },


    receive_search (obj) {
      this.searchAll = obj;
      this.getNewsAll(obj);
    },
    getNewsAll (data) {
      this.loading = true;
      var params = {};
      data = data || {};
      params = data;
      this.$api.getUser.get_online_withdrawal(params).then(res => {
        if (res.data.code == 200) {
          this.list = res.data.result;
        }
        this.loading = false;
      });
    },
    handleSizeChange (val) {
      var params = this.searchAll;
      params.page = "";
      params.page_size = val;
      this.getNewsAll(params);
      this.pageSize = val;
    },
    handleCurrentChange (val) {
      this.currentPage = val;
      var params = this.searchAll;
      params.page = val;
      params.page_size = this.pageSize;
      this.getNewsAll(params);
    },

    reload () {
      this.getNewsAll(this.searchAll);
    }
  },
  beforeCreate () { },
  created () {
    this.getNewsAll();
  },
  computed: {}
};
</script>

<style lang="less" scoped>
.myblank button {
  margin: 5px 5px 0 0;
}
</style>
